<template>
    <div>
    <el-breadcrumb separator="/">
      <el-breadcrumb-item :to="{ path: '/' }">缺陷管理 </el-breadcrumb-item>
      <el-breadcrumb-item><a href="/">缺陷等级确认</a></el-breadcrumb-item>
       <el-breadcrumb-item><a href="/">等级确认</a></el-breadcrumb-item>
    </el-breadcrumb>
    <el-form :modle="RenWu" label-width="300px">
    <el-form-item label="任务编号">
     {{RenWu.no}}
    </el-form-item>
    <el-form-item label="线路编号">{{RenWu.xianLuNo}}</el-form-item>
    <el-form-item label="杆塔编号">{{RenWu.ganTaNo}}</el-form-item>
    <el-form-item label="缺陷类型">{{RenWu.type}}</el-form-item>
    <el-form-item label="完好率">{{RenWu.wanHaoLu}}</el-form-item>
    <el-form-item label="缺陷描述">{{RenWu.miaoShu}}</el-form-item>
    <el-form-item label="发现时间">{{RenWu.time}}</el-form-item>
    <el-form-item label="发现人">{{RenWu.userName}}</el-form-item>
    <el-form-item>
     <el-button @click='queding()'>确定</el-button>
     <el-button @click="fanhui()">返回</el-button>
    </el-form-item>
    </el-form>
    </div>
</template>

<script>
  import axios from 'axios'
  export default{
    data(){
      return{
        RenWu:JSON.parse(this.$route.query.Renwu),
        options:[{
          value:'一般',
        },
        {
          value:'紧急',
        },
        {
          value:'严重',
        }]
      }
    },
    methods:{
      queding:function(){
      console.log(this.RenWu.errorType==null)
      if(this.RenWu.errorType=="null"){
        this.$message('请选择严重等级')

        return
      }else{
        var self=this
        axios.post('http://localhost:8081/dianlixunjian/queDingDengJi',this.RenWu)
        .then(function(b){
          console.log(b)
        if(b.data==true){

          self.$message('缺陷保存成功')
        }else{
            self.$message('缺陷保存失败')
        }
        })
        .catch(function(e){
          console.log(e)
        })
      }
      },
      fanhui:function(){
      this.$router.push('/')
      }
    }
  }
</script>

<style>
</style>
